#include "producer.hpp"
#include "taskqueue.hpp"
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
producer::producer()
{
}
producer::~producer()
{
}
void producer::produce(taskqueue &taskQue)
{
    ::srand(::clock()); // 种随机种子
    int cnt = 20;
    while (cnt--)
    {
        int number = ::rand() % 100; // 产生随机数
        taskQue.push(number);
        cout << "Producer produce = " << number << endl;
        sleep(1);
    }
}